// routes路由配置的类型限制
import type { RouteRecordRaw } from 'vue-router';

export const routes: RouteRecordRaw[] = [
    {
        path: '/',
        component: () => import('@/layout/index.vue'),
        redirect: '/home',
        children: [
            {
                path: 'home',
                name: 'Home',
                component: () => import('@/views/Home/index.vue'),
                redirect: '/home/recommend',
                children: [
                    {
                        path: 'recommend',
                        name: 'Recommend',
                        component: () => import('@/views/Home/Main/components/Recommend/index.vue')
                    },
                    {
                        path: 'production',
                        name: 'Production',
                        component: () => import('@/views/Home/Main/components/Production/index.vue')
                    },
                    {
                        path: 'tutorial',
                        name: 'Tutorial',
                        component: () => import('@/views/Home/Main/components/Tutorial/index.vue')
                    },
                    {
                        path: 'subject',
                        name: 'Subject',
                        component: () => import('@/views/Home/Main/components/Subject/index.vue')
                    },
                    {
                        path: 'dynamic',
                        name: 'Dynamic',
                        component: () => import('@/views/Home/Main/components/Dynamic/index.vue')
                    },
                    {
                        path: 'attention',
                        name: 'Attention',
                        component: () => import('@/views/Home/Main/components/Attention/index.vue')
                    },
                ]
            },
            {
                path: 'course',
                name: 'Course',
                component: () => import('@/views/Course/index.vue'),
                redirect: '/course/vip1',
                children: [
                    {
                        path: 'belowLine',
                        name: 'BelowLine',
                        component: () => import("@/views/Course/components/belowLine/belowLinePart.vue")
                    },
                    {
                        path: 'liveCourse',
                        name: 'LiveCourse',
                        component: () => import("@/views/Course/components/liveCourse/liveCoursePart.vue")
                    },
                    {
                        path: 'theme',
                        name: 'theMe',
                        component: () => import("@/views/Course/components/theme/theMePart.vue")
                    },
                    {
                        path: 'video',
                        name: 'Video',
                        component: () => import("@/views/Course/components/video/videoPart.vue")
                    },
                    {
                        path: 'vip1',
                        name: 'Vip1',
                        component: () => import("@/views/Course/components/vip/vipPart.vue")
                    }
                ]
            },
            {
                path: 'trainingroom',
                name: 'TrainingRoom',
                component: () => import('@/views/TrainingRoom/index.vue'),
                redirect: '/trainingroom/mytrainingroom',
                children: [
                    {
                        path: 'mytrainingroom',
                        name: 'Mytrainingroom',
                        component: () => import('@/views/TrainingRoom/Mytrainingroom/index.vue'),
                    },
                    {
                        path: 'mediacache',
                        name: 'MediaCache',
                        component: () => import('@/views/TrainingRoom/MediaCache/index.vue')
                    },
                    {
                        path: 'collections',
                        name: 'Collections',
                        component: () => import('@/views/TrainingRoom/Collections/index.vue'),
                    },
                    {
                        path: 'history',
                        name: 'History',
                        component: () => import('@/views/TrainingRoom/History/index.vue')
                    }
                ]
            },
            {
                path: 'communication',
                name: 'Communication',
                redirect: '/communication/header',
                component: () => import('@/views/Communication/index.vue'),
                children: [
                    {
                        path: 'communicationAside',
                        name: 'CommunicationAside',
                        component: () => import('@/views/Communication/CommunicationAside/index.vue')
                    },
                    {
                        path: 'header',
                        name: 'Header',
                        component: () => import('@/views/Communication/Header/index.vue')
                    },
                    {
                        path: 'main',
                        name: 'Main',
                        component: () => import('@/views/Communication/Main/index.vue')
                    },
                    {
                        path: 'hoDong',
                        name: 'HoDong',
                        component: () => import('@/views/Communication/HoDong/index.vue')
                    },

                ]
            },
            {
                path: 'my',
                name: 'My',
                component: () => import('@/views/My/index.vue'),
                redirect: '/my/resource',
                children: [
                    {
                        path: 'resource',
                        name: 'MySide',
                        component: () => import('@/views/My/Resource-dynamics/index.vue'),
                        meta: { tittle: '资源动态' }
                    }, {
                        path: 'vip',
                        name: 'MyVip',
                        component: () => import('@/views/My/MyVip/index.vue'),
                        meta: { tittle: '我的会员' }
                    }, {
                        path: 'cash',
                        name: 'MyCash',
                        component: () => import('@/views/My/MyCash/index.vue'),
                        meta: { tittle: '我的钱包' }
                    }, {
                        path: 'count',
                        name: 'MyCount',
                        component: () => import('@/views/My/MyCount/index.vue'),
                        meta: { tittle: '我的优惠券' }
                    }, {
                        path: 'order',
                        name: 'MyOrder',
                        component: () => import('@/views/My/MyOrder/index.vue'),
                        meta: { tittle: '我买的订单' }
                    }, {
                        path: 'sale',
                        name: 'MySale',
                        component: () => import('@/views/My/MySale/index.vue'),
                        meta: { tittle: '我卖的' },
                        children: [
                            {
                                path: 'OrderManagement',
                                name: 'OrderManagement',
                                component: () => import('@/views/My/MySale/OrderManagement/index.vue'),
                                meta: { tittle: '订单管理' }
                            },
                            {
                                path: 'CommodityManagement',
                                name: 'CommodityManagement',
                                component: () => import('@/views/My/MySale/CommodityManagement/index.vue'),
                                meta: { tittle: '商品管理' }
                            },
                            {
                                path: 'CustomerManagement',
                                name: 'CustomerManagement',
                                component: () => import('@/views/My/MySale/CustomerManagement/index.vue'),
                                meta: { tittle: '客户管理' }
                            },
                            {
                                path: 'UnCollected',
                                name: 'UnCollected',
                                component: () => import('@/views/My/MySale/UnCollected/index.vue'),
                                meta: { tittle: '待收款' }
                            },
                            {
                                path: 'PrivilegeManagement',
                                name: 'PrivilegeManagement',
                                component: () => import('@/views/My/MySale/PrivilegeManagement/index.vue'),
                                meta: { tittle: '优惠管理' }
                            },
                            {
                                path: 'EvaluationManagement',
                                name: 'EvaluationManagement',
                                component: () => import('@/views/My/MySale/EvaluationManagement/index.vue'),
                                meta: { tittle: '评价管理' }
                            },
                            {
                                path: 'Margin',
                                name: 'Margin',
                                component: () => import('@/views/My/MySale/Margin/index.vue'),
                                meta: { tittle: '保证金' }
                            },
                        ]
                    }, {
                        path: 'data',
                        name: 'MyData',
                        component: () => import('@/views/My/MyData/index.vue'),
                        meta: { tittle: '我的资料' }
                    }
                ]
            },
            {
                path: 'userinfo',
                name: 'Userinfo',
                component: () => import('@/views/UserInfo/index.vue'),
                redirect: '/userinfo/pdp',
                children: [
                    {
                        path: 'pdp',
                        name: 'pdp',
                        component: () => import('@/views/UserInfo/components/PDP/index.vue')
                    }, {
                        path: 'gst',
                        name: 'gst',
                        component: () => import('@/views/UserInfo/components/GST/index.vue')
                    }
                ]
            },
            {
                path: 'editmypersonalpage',
                name: 'editMyPersonalPage',
                component: () => import('@/views/editMyPersonalPage/index.vue')
            }
        ]
    },
    {
        path: '/404',
        name: '404',
        component: () => import('@/views/NotFound/index.vue')
    },
    // 任意路由
    {
        path: '/:pathMatch(.*)',
        name: 'Any',
        redirect: '/404'
    }
];
